using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace eTMS.Controls
{
	/// <summary>
	/// Summary description for Panel.
	/// </summary>
	public class Panel:System.Windows.Forms.Panel
	{
        public Panel()
        {
            DoubleBuffered = true;
        }
		private Color borderColor=Color.Silver;		
		public Color BorderColor{
			get{
				return borderColor;
			}
			set{
				borderColor=value;
				this.Invalidate();
			}
		}	
		private void DrawBorder(Graphics g){
			Pen p=new Pen(this.borderColor);
			g.DrawRectangle(p,this.ClientRectangle);
			p.Dispose();
		}		
		protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint (e);
			OnDraw(e);
		}

		protected virtual void OnDraw(PaintEventArgs e)
		{		
			DrawBorder(e.Graphics);
		}

	}
}
